package com.veryGood.service.Impl;

import com.veryGood.common.result.R;
import com.veryGood.domain.pojo.PurchaseInfo;
import com.veryGood.domain.pojo.SalesInfo;
import com.veryGood.mapper.PrintManageMapper;
import com.veryGood.service.PrintManageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author 南宫
 * @version 1.0
 * @date 2024-01-28 下午4:52
 */

@Service
public class PrintManageServiceImpl implements PrintManageService {

    @Autowired
    private PrintManageMapper mapper;

    @Override
    public R getAllrukuDan(Integer page,Integer limit) {
        List<PurchaseInfo> msg = mapper.queryAllrukuMsg((page-1)*limit,limit);
        System.err.println((page-1)*limit);
        System.err.println(limit);
        if (msg.size() != 0) {
            return R.success("查询成功", msg);
        }
        return R.error("查询失败");
    }

    @Override
    public R getAllchukuDan(Integer page,Integer limit) {
        List<SalesInfo> msg = mapper.queryAllchukuMsg((page-1)*limit,limit);

        if (msg.size() != 0) {
            return R.success("查询成功", msg);
        }
        return R.error("查询失败");
    }
}
